package cn.sjx.org.service.impl;

import cn.sjx.basic.service.impl.BasicServiceImpl;
import cn.sjx.org.domain.Department;
import cn.sjx.org.domain.Employee;
import cn.sjx.org.domain.EmployeeRoleDTO;
import cn.sjx.org.mapper.EmployeeMapper;
import cn.sjx.org.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl extends BasicServiceImpl<Employee>implements EmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;

    @Override
    public List<Employee> getAll() {
        return employeeMapper.getAll();

    }

    @Override
    public void setRole(EmployeeRoleDTO employeeRoleDTO) {
        employeeMapper.deleteRoleById(employeeRoleDTO.getId());
        employeeMapper.setRole(employeeRoleDTO);
    }
}
